const express = require('express');
const router = express.Router();
const paperController = require('../controllers/paper');
const { paperGenerateValidator } = require('../middleware/validator');

/**
 * @route POST /api/paper/generate
 * @desc 生成试卷
 * @access Public
 */
router.post('/generate', paperGenerateValidator, paperController.generatePaper);

/**
 * @route GET /api/paper/export/:resourceId
 * @desc 导出试卷为PDF
 * @access Public
 */
router.get('/export/:resourceId', paperController.exportPaper);

/**
 * @route GET /api/paper/:resourceId
 * @desc 获取试卷详情
 * @access Public
 */
router.get('/:resourceId', paperController.getPaperDetail);

module.exports = router;